using System;
using System.Windows.Forms;
using Curriculum.Business.Manejadores;

namespace Curriculum.UI.Clases.ManejadorControles
{
	/// <summary>
	/// Summary description for ManejadorTXT.
	/// </summary>
	public class ManejadorTextBox : ManejadorControles
	{
		public ManejadorTextBox()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		public override void Cargar(System.Windows.Forms.Control ctrl, object value)
		{
			((TextBox)ctrl).Text = (string) value;
		}
		public override void Inicializar(Control ctrl, object value)
		{
			char separator = ':';
			string idAtributo = value.ToString().Split(separator)[1];
			int longitud = MasterData.GetInstancia().GetAtributo(idAtributo).longitud;
			((TextBox)ctrl).MaxLength = longitud;
		}
		public override string GetValor(Control ctrl)
		{
			return ((TextBox)ctrl).Text;
		}
	}
}
